-
Notifications
You must be signed in to change notification settings - Fork 321
KaTeX(6/n): Handle 'nulldelimiter' class in spans #1633
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
b99baa2
to
f9a5b1c
Compare
f9a5b1c
to
228289a
Compare
3f63303
to
963a650
Compare
Thanks for building this! See my comments on #1670 for a few things I'd like to see on all the open KaTeX PRs: #1670 (review), #1670 (comment) . |
27988df
to
3852980
Compare
3852980
to
ec457a2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Generally this all looks good; just nits below.
No change in total failed messages, so most uses in the wild also depend on some other feature currently unimplemented (probably fractions).
Ah well. I think this is a prerequisite for those, though (#1678), and fractions are certainly a useful feature.
static final nulldelimiter = KatexExample.block( | ||
r'\{left,middle,right}. : spans with "nulldelimiter" class', | ||
// https://chat.zulip.org/#narrow/channel/7-test-here/topic/Rajesh/near/2205534 | ||
r'\left. a \middle. b \right.', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Huh interesting — I didn't know you could use .
that way in TeX 🙂
test/model/katex_test.dart
Outdated
@@ -643,6 +643,38 @@ class KatexExample extends ContentExample { | |||
text: '∗'), | |||
]), | |||
]); | |||
|
|||
static final nulldelimiter = KatexExample.block( | |||
r'\{left,middle,right}. : spans with "nulldelimiter" class', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using curly braces for this shell-like syntax here in a TeX formula is confusing, because braces have their own quite different meaning in TeX.
It looks like "null delimiter" is the TeX term for what's going on here — search for that term in the TeXbook:
https://visualmatheditor.equatheque.net/doc/texbook.pdf
So we can use that term in the test description:
r'\{left,middle,right}. : spans with "nulldelimiter" class', | |
r'null delimiters, like `\left.`', |
test/model/katex_test.dart
Outdated
'<span class="base">' | ||
'<span class="strut" style="height:0.6944em;"></span>' | ||
'<span class="minner">' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: indentation; the .minner is a sibling, not child, of the .strut
'<span class="base">' | |
'<span class="strut" style="height:0.6944em;"></span>' | |
'<span class="minner">' | |
'<span class="base">' | |
'<span class="strut" style="height:0.6944em;"></span>' | |
'<span class="minner">' |
KatexSpanNode(nodes: [ | ||
KatexStrutNode(heightEm: 0.6944, verticalAlignEm: null), | ||
KatexSpanNode(nodes: [ | ||
KatexSpanNode(styles: KatexSpanStyles(widthEm: 0.12), nodes: []), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: simplify
KatexSpanNode(styles: KatexSpanStyles(widthEm: 0.12), nodes: []), | |
KatexSpanNode(styles: KatexSpanStyles(widthEm: 0.12)), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm we need to specify an empty list here, because we currently require either text
or nodes
to be non-null in KatexSpanNode
.
ec457a2
to
14e70fe
Compare
14e70fe
to
7c1a449
Compare
Thanks for the review @gnprice. Pushed an update, PTAL. |
Survey results
No change in total failed messages, so most uses in the wild also depend on some other feature currently unimplemented (probably fractions).
Fixes: #1677